﻿@{
    Layout = null;
}
@model Nop.Services.Logistics.OrderInformation

@if (@Model != null)
{
<table class="adminContent">
    <tr>
        <td class="adminTitle">
            Order status:
        </td>
        <td class="adminData">
            @Model.OrderCompleted
        </td>
    </tr>
    <tr>
        <td class="adminTitle">
            Payment status:
        </td>
        <td class="adminData">
            @Model.OrderPaid
        </td>
    </tr>
    <tr>
        <td class="adminTitle">
            User address ID:
        </td>
        <td class="adminData">
            @Model.UserAddressId
        </td>
    </tr>
    @foreach (var l in @Model.Locations)
    {
        <tr>
            <td class="adminTitle">
                Total package:
            </td>
            <td class="adminData">
                @l.PackageNumber
            </td>
        </tr>

        <tr>
            <td class="adminTitle">
                location address ID:
            </td>
            <td class="adminData">
                @l.AddressId
            </td>
        </tr>
        foreach (var p in l.Packages)
        {
            <tr>
                <td class="adminTitle">
                    Package #
                </td>
                <td class="adminData">
                    @p.Id
                </td>
            </tr>
            <tr>
                <td class="adminTitle">
                    Package size:
                </td>
                <td class="adminData">
                    @if (p.IsLettersize)
                    {
                        <text>Standard</text>
                    }
                    else
                    {
                        <text>Non-Standard</text>
                    }
                </td>
            </tr>        
        }
    }
    @if (!Model.OrderPaid && Model.OrderCompleted)
    {
        <input type="submit" name="placeexpressorder" class="t-button" value="Place Pending Order" />
    }
</table>
}
else
{
    <table class="adminContent">
        <tr>
            <td>
                <br />
                @if (!ViewBag.HasPermission)
                {
                    <text>You have no permission to view the current order.</text>
                }
                else
                {
                    <text>The current order is empty.</text>
                }
                <br />
            </td>
        </tr>
    </table>
}
